<?php
require_once('CView.php');
require_once('CNavigationBar.php');
class CHeader extends CView
{
	protected $nav_bar;
	protected $head;
	
	public function __construct()
	{
		parent::__construct();
		$this->nav_bar = new CNavigationBar();
		$this->nav_bar->css_class = "CHeaderNavigationBar";
		$this->head = new CPanel();
	}
	
	public function render_contents()
	{
		return $this->head->render() . $this->nav_bar->render();
	}
	
	public function get_navigation_bar()
	{
		return $this->nav_bar;
	}
	
	public function set_navigation_bar($component)
	{
		if (!is_object($component) || !is_a($component, "CNavigationBar"))
			throw new CViewInvalidComponentException();
		else
			$this->nav_bar = $component;
	}
	
	public function get_header()
	{
		return $this->head;
	}
	
	public function set_header($component)
	{
		if (!is_object($component) || !is_a($component, "CView"))
			throw new CViewInvalidComponentException();
		else
			$this->head = $component;
	}
}
?>